“The study of computational systems that use ideas inspired from natural evolution, e.g., the principle of survival of the fittest.”

Evolutionary Computation

EC provides a general method for solving ‘search for solutions’ type of problems, such as optimisation, learning, and design.

Progress:

Week 2…

 

What will be covered?

Algorithms

Theory

 

Categories of Algorithms by by design paradigm

###

Travelling salesman problem (TSP)

Given a list of cities xiRn and the distances matrix between each pair of them.

Seek for the shortest rout that visits each city exactly once and returns to the origin city.

image-20220217164956175

Solve TSP using:

Randomised Algorithm

Start with Question: Matching one Bolt to n Distinct Sizes Nuts:

given one bolt and a collection of n nuts of different sizes, find a nut match the bolt

The brute-force solution time complexity: O(n2)

Answer: For many problems, a randomised algorithm is the simplest, the fastest.

 

Heuristic Algo

CS definition of heuristic: a (usually simple) algorithm that produces a good enough solution for a problem in a reasonable time frame

heuristic: find or discover non-optimal but satisfactory

Trad of optimality, completness, accuracy or precision for speed.

Includes determiistic (e.g. 0 or 1 results)

 

makes random choices during execution,

output and runtime can vary even with fixed input.

 

Use random number to help find and improve the solutions.

Two representatives:

O(1) is fixed

 

Randomised Quicksort Algo

avg: O(nlogn), worst: O(2nlogn)

image-20220203123055102

 

Local Search Algorithms

A heuristic algorithm for solving hard optimization problems.

Idea: start with an initial guess at a solution and incrementally improve it until it is one

Incremental improvement: local changes, e.g., the algorithm iteratively moves to a neighbour solution

Neighbour solution: Depends on the definition of a neighbourhood relation on the search space, but generally based on similarity (distance) measure

Hill Climbing Algo

Climbing Everest in thick fog with amnesia

Search for its better Immediate neighbour solutions, which is the most similar solutions to the current solution.

Two types of hill climbing:

2-Opt Algorithm

Detailed swapping steps for swapping two edges, which result in an immediate neighbour solutions:

image-20220217171108568

What is 3-Opt Algo?

 

#TODO How to draw fitness landscape in high dimension?

Randomised search vs Local search

Stochastic Local Search algorithms

Main idea: escape or avoid local optima, introduce randomness into local search algo.

Escape stategies:

image-20220217172459663

image-20220217172517865

Accepting worse solutions with a certain probability, e.g., P:=exp(eenew T) if enew e, which is worse.

Other: Tabu Search

Evolutionary Algorithms

image-20220217152919465

An Evolutionary Algorithms consists of: representation: each solution is called an individual fitness (objective) function: to evaluate solutions variation operators: mutation and crossover selection and reproduction : survival of the fittest

image-20220217153808942

image-20220217153830477

image-20220217160836329

 

Genetic Algorithm (GA)

natrual selection: survival of the fittest,

Observation: Natural Evolution has evolved many complex systems (e.g., brain) and ”solved” many bioengineering problem.

Driving Force: Simulate Genetic variations that enhance survival and reproduction become and remain more common in successive generations of a population (idea of Darwinian Evolution).

Initialization: requires many setting, including initial population, population size, selection, reproduction, mutation, and criteria for termination of algorithm.

Genotype (基因型): Binarye encoded solution G{0,1}L with length of L assimilates Chromosomes (染色体).

Phenotype (表现型): Decode solution from Genotype.

variation
Decode
Selection
Encode
Genotype
New_Genotype
Phenotype
New_Phenotype

Genetic variation Operators

Decoding Function

h(Ki)=ui+Kiviui2Ln1

 

For example, assume X={x1,x2,x2} and X[5,5].

image-20220217161833485

Selection

 

Selection usually is performed before variation operators: selects better fit individuals for breeding

 

Emphasising on exploiting better solutions in a population:

Question: Why we still select those inferior solutions?

Allows some weak individuals who may help escaping from local optima. Because super individuals normally cause low separation among individuals, lead to premature convergence to a local optimum.

Selection schemes:

Fitness Proportional Selection

Selecting individual i with a probability:

pi=fij=1Mfj

where fi is the fitness value of i, M is the number of individuals.

How to maintain selection pressure throughout the run?

Linear Scaling: fi=a+bfi,

usually we set a to the max(f) and b to the min(f)/M<1.


Ranking Selection

Select top γ-ranked individuals with probability function p(γ), where γ=0M1=1.




p(γ)=1eγC

Truncate selection


Tournament Selection

Binary tournament selection (k = 2) is the most popular selection methods in GA.


(μ+λ) and (μ,λ) selection

(μ+λ) selection:

(μ,λ) selection where λ>μ, only choose best individuals among offspring


Pros and Cons of GA

Selection pressure is the degree to which selection emphasises on the better individuals.

Scheme is a template that identifies a subset of strings with similarities at certain string positions

Pros:

Binary GA maximises the level of implicit parallelism.

Implicit parallelism:

image-20220219105501130

Drawbacks of Binary Coding

Problem in discrete search spaces

Problem in continuous search spaces

Hamming cliff problem: one-bit mutation can make a large (or a small) jump; a multi-bit mutation can make a small (or large) jump.

image-20220219105852884

Solution - Gray encoding

For a{0,1}L and b{0,1}L where a is the standard binary encoded, and b is Gray encoded, then:

bi={ai if i=1ai1ai if i>1

image-20220219110319880

Mutation

randomly select a parent with pm, then randomly select a gene ci and apply mutation operator.

Crossover

Randomly select two parents x1={x1[1],x2[1],,xn[1]} and x2={x1[2],x2[2],,xn[2]}, then apply a crossover operator.

image-20220219123427145

 

GA Example Problem

image-20220219123706019

image-20220219124007068

Constraint Handling in Evolutionary Algorithms

Below is a benchmark which can be used to test the constraint optimization algorithm:

image-20220314110411029

So we want to minimize:

f(X)=(x3+2)x2x12

Subject to

image-20220314110711347